<template>
  <div>
    <fc-designer
        ref="designer"
        v-model="fapi"
        :rule="rule"
        :option="option"
        class="fcdesigner"
        :style="'height:'+designerheight"
        @submit="onSubmit"
    />
  </div>
</template>

<script>
import Vue from 'vue'
import formCreate from '@form-create/element-ui'
import FcDesigner from '@form-create/designer'

Vue.use(formCreate)
Vue.use(FcDesigner)
export default {
  name: "designer",
  data() {
    return {
      designerheight:'600px',
      fapi: null,
      rule:[],
      option: formCreate.parseJson('{"submitBtn": false,"resetBtn": false,"form":{"labelPosition":"right","size":"mini","labelWidth":"125px","hideRequiredAsterisk":false,"showMessage":true,"inlineMessage":false}}'),
    }
  },
  mounted() {
    this.designerheight = document.documentElement.clientHeight - 145 + 'px';
    // this.$refs.designer.setRule(true)
  },
  methods: {
    onSubmit() {

    }
  }
}
</script>

<style scoped>

</style>